import request from '.';

/**
 * 获取城市列表
 * guess 定位城市
 * hot 热门城市
 * group 所有城市
 *
 * @param {*} type
 */
export const fetchCity = type =>
    request.get('/v1/cities', { params: { type } });

/**
 * 获取当前所在城市
 */
export const currentCity = id => fetch(`/v1/cities/${id}`);

/**
 * 获取搜索地址
 */
export const searchPlace = (cityId, keyword) =>
    request.get('/v1/pois', {
        type: 'search',
        city_id: cityId,
        keyword
    });
